import * as types from './types';
export default {
    //修改用户信息
    update_userinfo ({commit},{userinfo}) {
        return new Promise((resolve, reject) => {
            commit(types.UPDATE_USERINFO, {
                userinfo
            });
            resolve()
        });
    },//同步更新用户信息
    update_userinfo_sync: ({
        commit
    }, {
        userinfo
    }) => {
        commit(types.UPDATE_USERINFO, {
            userinfo
        });
    },//修改用户图片
    update_userpic: ({
        commit
    }, {
        picurl
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.UPDATE_USERPIC, picurl);
            resolve()
        });
    },//修改用户名
    update_realname: ({
        commit
    }, {
        realName
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.UPDATE_REALNAME, realName);
            resolve()
        });
    },
    update_vip: ({
        commit
    }, {
        vip
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.UPDATE_VIP, vip);
            resolve()
        });
    },
    remove_userinfo: ({
        commit
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.REMOVE_USERINFO);
            resolve()
        });
    },


    update_remumber: ({
        commit
    }, {
        remumber_flag,
        remumber_login_info
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.UPDATE_REMUMBER, {
                remumber_flag,
                remumber_login_info
            });
            resolve()
        });
    },

    remove_remumber: ({
        commit
    }) => {
        return new Promise((resolve, reject) => {
            commit(types.REMOVE_REMUMBER);
            resolve()
        });
    }
}